﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RBOSS.Business.Smtp;

namespace RBOSS.WebUI
{
    public partial class ContactUs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ContactUsClick(object sender, EventArgs e)
        {
            var name = txtName.Text;
            var email = txtEmail.Text;
            var company = txtCompany.Text;
            var phone = txtPhone.Text;
            var message = txtMessage.Text;

            var contactMessageToSend = new StringBuilder();
            contactMessageToSend.Append("Name : " + name).AppendLine();
            contactMessageToSend.Append("Email : " + email).AppendLine();
            contactMessageToSend.Append("Company : " + company).AppendLine();
            contactMessageToSend.Append("Phone : " + phone).AppendLine();
            contactMessageToSend.Append("Message : " + message).AppendLine();

            SmtpMail.SendGmail("Contact", contactMessageToSend.ToString(), new[] {"rboss.noreply@gmail.com"},
                "rboss.noreply@gmail.com");

            ContactMessage.Visible = true;
            Message.Text = "Message sent successfully... You will be notified in short period of time. Thank you!!!";

            divContactUs.Visible = false;
        }
    }
}